import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import MainPage from "../views/main/MainPage";
import Login from "../views/Login";
import Register from "../views/Register"

Vue.use(VueRouter);

const routes = [
  { path: "/login", name: "Login", component: Login },
  { path: "/register", name: "Register", component: Register },
  {
    path: "/",
    name: "Home",
    component: Home,
    children: [
      { name: "mainpage", path: "/", component: MainPage },
      {
        name: "plant-material", path: "/material", component: () => import("@/views/material/PlantMaterial")
      },
      {
        name: 'pdetail', path: '/pdetail', component: () => import('@/views/material/components/Pdetail')
      },

      {
        name: "base-case", path: "/base", component: () => import("@/views/case/BaseCase")
      },
      {
        name: "overview", path: '/overview', component: () => import('@/views/case/components/Overview')
      },
      {
        name: 'cdetail', path: '/cdetail', component: () => import('@/views/case/components/CaseDetail')
      },
      {
        name: "compre-case", path: "/compre", component: () => import("@/views/comprecase/CompreCase")
      },
      {
        name: "c_overview", path: '/c_overview', component: () => import('@/views/comprecase/components/Overview')
      },
      {
        name: 'ccdetail', path: '/ccdetail', component: () => import('@/views/comprecase/components/ComCaseDetail')
      },
      {
        name: "lumion", path: "/lumion", component: () => import("@/views/lumion/Lumion")
      }
    ]
  }
  // {
  //   path: "/about",
  //   name: "About",
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () =>
  //     import(/* webpackChunkName: "about" */ "../views/About.vue")
  // }
];


const router = new VueRouter({
  mode: "history",
  routes,
  scrollBehavior: () => ({ y: 0 }),
});

export default router;
